home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / hm--html.000 / hm--html / hm--html-menus / hm--html-keys.el < prev    next >
Encoding:
Text File  |  1995-09-17  |  27.6 KB  |  691 lines

  1. ;;; hm--html-keys.el
  2. ;;; v1.30; 17-Sep-1995
  3. ;;; Copyright (C) 1995 Heiko Muenkel
  4. ;;; email: muenkel@tnt.uni-hannover.de
  5. ;;;
  6. ;;;  This program is free software; you can redistribute it and/or modify
  7. ;;;  it under the terms of the GNU General Public License as published by
  8. ;;;  the Free Software Foundation; either version 1, or (at your option)
  9. ;;;  any later version.
  10. ;;;
  11. ;;;  This program is distributed in the hope that it will be useful,
  12. ;;;  but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;;  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. ;;;  GNU General Public License for more details.
  15. ;;;
  16. ;;;  You should have received a copy of the GNU General Public License
  17. ;;;  along with this program; if not, write to the Free Software
  18. ;;;  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  19. ;;;
  20. ;;; 
  21. ;;; Description:
  22. ;;;
  23. ;;;    Defines the new keybindigs for the hm--html-menus package.
  24. ;;;    At the moment it will only be used, if the variable
  25. ;;;    'hm--html-use-old-keymap' in hm--html-configuration.el
  26. ;;;    is set to nil, which is the default.
  27. ;;; 
  28. ;;; Installation: 
  29. ;;;   
  30. ;;;    Put this file in one of your load path directories.
  31. ;;;
  32.  
  33. (provide 'hm--html-keys)
  34.  
  35.  
  36. (defvar hm--html-noregion-anchor-map nil
  37.   "Noregion sub keymap for inserting anchors.")
  38.  
  39. (if hm--html-noregion-anchor-map
  40.     ()
  41.   (setq hm--html-noregion-anchor-map (make-sparse-keymap))
  42.   (define-key hm--html-noregion-anchor-map "h" 'hm--html-add-html-link)
  43.   (define-key hm--html-noregion-anchor-map "i" 'hm--html-add-info-link)
  44.   (define-key hm--html-noregion-anchor-map "g" 'hm--html-add-gopher-link)
  45.   (define-key hm--html-noregion-anchor-map "f" 'hm--html-add-file-link)
  46.   (define-key hm--html-noregion-anchor-map "\C-f" 'hm--html-add-ftp-link)
  47.   (define-key hm--html-noregion-anchor-map "n" 'hm--html-add-news-link)
  48.   (define-key hm--html-noregion-anchor-map "m" 'hm--html-add-mail-link)
  49.   (define-key hm--html-noregion-anchor-map "w" 'hm--html-add-direct-wais-link)
  50.   (define-key hm--html-noregion-anchor-map "\C-w" 'hm--html-add-wais-link)
  51.   (define-key hm--html-noregion-anchor-map "p" 'hm--html-add-proggate-link)
  52.   (define-key hm--html-noregion-anchor-map 
  53.     "\C-p" 'hm--html-add-local-proggate-link)
  54.   (define-key hm--html-noregion-anchor-map "l" 'html-add-normal-link)
  55.   (define-key hm--html-noregion-anchor-map "t" 'hm--html-add-link-target)
  56.   )
  57.  
  58. (defvar hm--html-region-anchor-map nil
  59.   "Region sub keymap for inserting anchors.")
  60.  
  61. (if hm--html-region-anchor-map
  62.     ()
  63.   (setq hm--html-region-anchor-map (make-sparse-keymap))
  64.   (define-key hm--html-region-anchor-map "h" 'hm--html-add-html-link-to-region)
  65.   (define-key hm--html-region-anchor-map "i" 'hm--html-add-info-link-to-region)
  66.   (define-key hm--html-region-anchor-map 
  67.     "g" 'hm--html-add-gopher-link-to-region)
  68.   (define-key hm--html-region-anchor-map "f" 'hm--html-add-file-link-to-region)
  69.   (define-key hm--html-region-anchor-map 
  70.     "\C-f" 'hm--html-add-ftp-link-to-region)
  71.   (define-key hm--html-region-anchor-map "n" 'hm--html-add-news-link-to-region)
  72.   (define-key hm--html-region-anchor-map "m" 'hm--html-add-mail-link-to-region)
  73.   (define-key hm--html-region-anchor-map 
  74.     "w" 'hm--html-add-direct-wais-link-to-region)
  75.   (define-key hm--html-region-anchor-map 
  76.     "\C-w" 'hm--html-add-wais-link-to-region)
  77.   (define-key hm--html-region-anchor-map 
  78.     "p" 'hm--html-add-proggate-link-to-region)
  79.   (define-key hm--html-region-anchor-map 
  80.     "\C-p" 'hm--html-add-local-proggate-link-to-region)
  81.   (define-key hm--html-region-anchor-map 
  82.     "l" 'hm--html-add-normal-link-to-region)
  83.   (define-key hm--html-region-anchor-map 
  84.     "t" 'html-add-reference-to-region)
  85.   )
  86.  
  87. (defvar hm--html-noregion-frame-map nil
  88.   "Noregion sub keymap for inserting frame elements.")
  89.  
  90. (if hm--html-noregion-frame-map
  91.     ()
  92.   (setq    hm--html-noregion-frame-map (make-sparse-keymap))
  93.   (define-key hm--html-noregion-frame-map "f" 'hm--html-add-full-html-frame)
  94.   (define-key hm--html-noregion-frame-map [(control h)] 'hm--html-add-html) 
  95.   (define-key hm--html-noregion-frame-map [(meta h)] 'hm--html-add-head)
  96.   (define-key hm--html-noregion-frame-map "b" 'hm--html-add-body)
  97.   (define-key hm--html-noregion-frame-map 
  98.     [(control t)] 'hm--html-add-title-and-header)
  99.   (define-key hm--html-noregion-frame-map "t" 'hm--html-add-title)
  100.   (define-key hm--html-noregion-frame-map "h" 'hm--html-add-header)
  101.   (define-key hm--html-noregion-frame-map "n" 'hm--html-add-normal-node-link)
  102.   (define-key hm--html-noregion-frame-map "a" 'html-add-address)
  103.   (define-key hm--html-noregion-frame-map "s" 'hm--html-add-signature)
  104.   (define-key hm--html-noregion-frame-map 
  105.     [(control c)] 'hm--html-insert-created-comment)
  106.   (define-key hm--html-noregion-frame-map "c" 'hm--html-insert-changed-comment)
  107.   (define-key hm--html-noregion-frame-map "d" 'hm--html-new-date)
  108.   )
  109.  
  110. (defvar hm--html-region-frame-map nil
  111.   "Region sub keymap for inserting frame elements.")
  112.  
  113. (if hm--html-region-frame-map
  114.     ()
  115.   (setq hm--html-region-frame-map (make-sparse-keymap))
  116.   (define-key hm--html-region-frame-map 
  117.     "f" 'hm--html-add-full-html-frame-with-region)
  118.   (define-key hm--html-region-frame-map 
  119.     [(meta h)] 'hm--html-add-head-to-region)
  120.   (define-key hm--html-region-frame-map "b" 'hm--html-add-body-to-region)
  121.   (define-key hm--html-region-frame-map 
  122.     [(control t)] 'hm--html-add-title-and-header-to-region)
  123.   (define-key hm--html-region-frame-map "t" 'hm--html-add-title-to-region)
  124.   (define-key hm--html-region-frame-map "h" 'hm--html-add-header-to-region)
  125.   (define-key hm--html-region-frame-map "a" 'hm--html-add-address-to-region)
  126.   )
  127.  
  128. (defvar hm--html-noregion-structure-map nil
  129.   "Noregion sub keymap for inserting entities.")
  130.  
  131. (if hm--html-noregion-structure-map
  132.     ()
  133.   (setq hm--html-noregion-structure-map (make-sparse-keymap))
  134.   (define-key hm--html-noregion-structure-map "i" 'html-add-list-or-menu-item)
  135.   (define-key hm--html-noregion-structure-map "m" 'html-add-menu)
  136.   (define-key hm--html-noregion-structure-map "u" 'html-add-list)
  137.   (define-key hm--html-noregion-structure-map "o" 'hm--html-add-numberlist)
  138.   (define-key hm--html-noregion-structure-map "d" 'hm--html-add-directory-list)
  139.   (define-key hm--html-noregion-structure-map 
  140.     "\C-dl" 'html-add-description-list)
  141.   (define-key hm--html-noregion-structure-map 
  142.     "\C-dt" 'hm--html-add-description-title)
  143.   (define-key hm--html-noregion-structure-map 
  144.     "\C-de" 'hm--html-add-only-description-entry)
  145.   (define-key hm--html-noregion-structure-map 
  146.     "\C-d\C-t" 'html-add-description-entry)
  147.   (define-key hm--html-noregion-structure-map
  148.     "\C-tt" 'hm--html-add-table)
  149.   (define-key hm--html-noregion-structure-map 
  150.     "\C-t\C-t" 'hm--html-add-table-title)
  151.   (define-key hm--html-noregion-structure-map 
  152.     "\C-th" 'hm--html-add-table-header)
  153.   (define-key hm--html-noregion-structure-map 
  154.     "\C-tr" 'hm--html-add-first-table-row)
  155.   (define-key hm--html-noregion-structure-map 
  156.     "\C-t\C-r" 'hm--html-add-additional-table-row)
  157.   (define-key hm--html-noregion-structure-map "p" 'hm--html-add-paragraph)
  158.   (define-key hm--html-noregion-structure-map 
  159.     "\C-p" 'hm--html-add-paragraph-separator)
  160.   (define-key hm--html-noregion-structure-map "\C-m" 'hm--html-add-line-break)
  161.   (define-key hm--html-noregion-structure-map 
  162.     "h" 'hm--html-add-horizontal-rule)
  163.   )
  164.  
  165. (defvar hm--html-region-structure-map nil
  166.   "Region sub keymap for inserting entities.")
  167.  
  168. (if hm--html-region-structure-map
  169.     ()
  170.   (setq hm--html-region-structure-map (make-sparse-keymap))
  171.   (define-key hm--html-region-structure-map "m" 'hm--html-add-menu-to-region)
  172.   (define-key hm--html-region-structure-map "u" 'hm--html-add-list-to-region)
  173.   (define-key hm--html-region-structure-map 
  174.     "o" 'hm--html-add-numberlist-to-region)
  175.   (define-key hm--html-region-structure-map 
  176.     "d" 'hm--html-add-directory-list-to-region)
  177.   (define-key hm--html-region-structure-map 
  178.     "\C-dl" 'html-add-description-list-to-region)
  179.   (define-key hm--html-region-structure-map
  180.     "\C-tt" 'hm--html-add-table-to-region)
  181.   (define-key hm--html-region-structure-map 
  182.     "\C-t\C-t" 'hm--html-add-table-title-to-region)
  183.   (define-key hm--html-region-structure-map 
  184.     "p" 'hm--html-add-paragraph-to-region)
  185.   )
  186.  
  187. (defvar hm--html-noregion-formating-paragraph-map nil
  188.   "Noregion sub keymap for inserting paragraph formating elements.")
  189.  
  190. (if hm--html-noregion-formating-paragraph-map
  191.     ()
  192.   (setq hm--html-noregion-formating-paragraph-map (make-sparse-keymap))
  193.   (define-key hm--html-noregion-formating-paragraph-map
  194.     "o" 'html-add-plaintext)
  195.   (define-key hm--html-noregion-formating-paragraph-map
  196.     "w" 'hm--html-add-preformated)
  197.   (define-key hm--html-noregion-formating-paragraph-map
  198.     "b" 'html-add-blockquote)
  199.   (define-key hm--html-noregion-formating-paragraph-map
  200.     "l" 'html-add-listing)
  201.   (define-key hm--html-noregion-formating-paragraph-map
  202.     "a" 'hm--html-add-abstract)
  203.   )
  204.  
  205. (defvar hm--html-region-formating-paragraph-map nil
  206.   "Region sub keymap for inserting paragraph formating elements.")
  207.  
  208. (if hm--html-region-formating-paragraph-map
  209.     ()
  210.   (setq hm--html-region-formating-paragraph-map (make-sparse-keymap))
  211.   (define-key hm--html-region-formating-paragraph-map
  212.     "o" 'hm--html-add-plaintext-to-region)
  213.   (define-key hm--html-region-formating-paragraph-map
  214.     "w" 'hm--html-add-preformated-to-region)
  215.   (define-key hm--html-region-formating-paragraph-map
  216.     "b" 'hm--html-add-blockquote-to-region)
  217.   (define-key hm--html-region-formating-paragraph-map
  218.     "l" 'hm--html-add-listing-to-region)
  219.   (define-key hm--html-region-formating-paragraph-map
  220.     "a" 'hm--html-add-abstract-to-region)
  221.   )
  222.  
  223. ;(defvar hm--html-noregion-entity-map nil
  224. ;  "Noregion sub keymap for inserting entities.")
  225.  
  226. ;(if hm--html-noregion-entity-map
  227. ;    ()
  228. ;  (setq hm--html-noregion-entity-map (make-sparse-keymap))
  229. ;  )
  230.  
  231. ;(defvar hm--html-region-entity-map nil
  232. ;  "Region sub keymap for inserting entities.")
  233.  
  234. ;(if hm--html-region-entity-map
  235. ;    ()
  236. ;  (setq hm--html-region-entity-map (make-sparse-keymap))
  237. ;  )
  238.  
  239. ;(defvar hm--html-noregion-logical-map nil
  240. ;  "Noregion sub keymap for inserting logical text formating elements.")
  241.  
  242. ;(if hm--html-noregion-logical-map
  243. ;    ()
  244. ;  (setq hm--html-noregion-logical-map (make-sparse-keymap))
  245. ;  )
  246.  
  247. ;(defvar hm--html-region-logical-map nil
  248. ;  "Region sub keymap for inserting logical text formating elements.")
  249.  
  250. ;(if hm--html-region-logical-map
  251. ;    ()
  252. ;  (setq hm--html-region-logical-map (make-sparse-keymap))
  253. ;  )
  254.  
  255. (defvar hm--html-noregion-formating-word-map nil
  256.   "Norgion sub keymap for inserting physical text formating elements.")
  257.  
  258. (if hm--html-noregion-formating-word-map
  259.     ()
  260.   (setq hm--html-noregion-formating-word-map (make-sparse-keymap))
  261.   (define-key hm--html-noregion-formating-word-map
  262.     "b" 'hm--html-add-bold)
  263.   (define-key hm--html-noregion-formating-word-map
  264.     "i" 'hm--html-add-italic)
  265.   (define-key hm--html-noregion-formating-word-map
  266.     "u" 'hm--html-add-underline)
  267.   (define-key hm--html-noregion-formating-word-map
  268.     "t" 'html-add-fixed)
  269.   (define-key hm--html-noregion-formating-word-map
  270.     "s" 'hm--html-add-strikethru)
  271.   (define-key hm--html-noregion-formating-word-map
  272.     "\C-p" 'hm--html-add-superscript)
  273.   (define-key hm--html-noregion-formating-word-map
  274.     "\C-b" 'hm--html-add-subscript)
  275.   (define-key hm--html-noregion-formating-word-map
  276.     "e" 'html-add-emphasized)
  277.   (define-key hm--html-noregion-formating-word-map
  278.     "\C-s" 'html-add-strong)
  279.   )
  280.  
  281. (defvar hm--html-region-formating-word-map nil
  282.   "Region sub keymap for inserting word text formating elements.")
  283.  
  284. (if hm--html-region-formating-word-map
  285.     ()
  286.   (setq hm--html-region-formating-word-map (make-sparse-keymap))
  287.   (define-key hm--html-region-formating-word-map
  288.     "b" 'hm--html-add-bold-to-region)
  289.   (define-key hm--html-region-formating-word-map
  290.     "i" 'hm--html-add-italic-to-region)
  291.   (define-key hm--html-region-formating-word-map
  292.     "u" 'hm--html-add-underline-to-region)
  293.   (define-key hm--html-region-formating-word-map
  294.     "t" 'hm--html-add-fixed-to-region)
  295.   (define-key hm--html-region-formating-word-map
  296.     "s" 'hm--html-add-strikethru-to-region)
  297.   (define-key hm--html-region-formating-word-map
  298.     "\C-p" 'hm--html-add-superscript-to-region)
  299.   (define-key hm--html-region-formating-word-map
  300.     "\C-b" 'hm--html-add-subscript-to-region)
  301.   (define-key hm--html-region-formating-word-map
  302.     "e" 'hm--html-add-emphasized-to-region)
  303.   (define-key hm--html-region-formating-word-map
  304.     "\C-s" 'hm--html-add-strong-to-region)
  305.   )
  306.  
  307. ;(defvar hm--html-noregion-header-map nil
  308. ;  "Noregion sub keymap for inserting header elements.")
  309.  
  310. ;(if hm--html-noregion-header-map
  311. ;    ()
  312. ;  (setq hm--html-noregion-header-map (make-sparse-keymap))
  313. ;  )
  314.  
  315. ;(defvar hm--html-region-header-map nil
  316. ;  "Region sub keymap for inserting header elements.")
  317.  
  318. ;(if hm--html-region-header-map
  319. ;    ()
  320. ;  (setq hm--html-region-header-map (make-sparse-keymap))
  321. ;  )
  322.  
  323. ;(defvar hm--html-noregion-head-map nil
  324. ;  "Noregion sub keymap for inserting head elements.")
  325.  
  326. ;(if hm--html-noregion-head-map
  327. ;    ()
  328. ;  (setq hm--html-noregion-head-map (make-sparse-keymap))
  329. ;  )
  330.  
  331. ;(defvar hm--html-region-head-map nil
  332. ;  "Region sub keymap for inserting head elements.")
  333.  
  334. ;(if hm--html-region-head-map
  335. ;    ()
  336. ;  (setq hm--html-region-head-map (make-sparse-keymap))
  337. ;  )
  338.  
  339. ;(defvar hm--html-noregion-list-map nil
  340. ;  "Noregion sub keymap for inserting lists.")
  341.  
  342. ;(if hm--html-noregion-list-map
  343. ;    ()
  344. ;  (setq hm--html-noregion-list-map (make-sparse-keymap))
  345. ;  )
  346.  
  347. ;(defvar hm--html-region-list-map nil
  348. ;  "Region sub keymap for inserting lists.")
  349.  
  350. ;(if hm--html-region-list-map
  351. ;    ()
  352. ;  (setq hm--html-region-list-map (make-sparse-keymap))
  353. ;  )
  354.  
  355. (defvar hm--html-noregion-graphics-map nil
  356.   "Noregion sub keymap for inserting graphics (images).")
  357.  
  358. (if hm--html-noregion-graphics-map
  359.     ()
  360.   (setq hm--html-noregion-graphics-map (make-sparse-keymap))
  361.   )
  362.  
  363. (defvar hm--html-region-graphics-map nil
  364.   "Region sub keymap for inserting graphics (images).")
  365.  
  366. (if hm--html-region-graphics-map
  367.     ()
  368.   (setq hm--html-region-graphics-map (make-sparse-keymap))
  369.   )
  370.  
  371. (defvar hm--html-noregion-text-elements-map nil
  372.   "Noregion sub keymap for inserting text elements.")
  373.  
  374. (if hm--html-noregion-text-elements-map
  375.     ()
  376.   (setq hm--html-noregion-text-elements-map (make-sparse-keymap))
  377.   )
  378.  
  379. (defvar hm--html-region-text-elements-map nil
  380.   "Region sub keymap for inserting text elements.")
  381.  
  382. (if hm--html-region-text-elements-map
  383.     ()
  384.   (setq hm--html-region-text-elements-map (make-sparse-keymap))
  385.   )
  386.  
  387. (defvar hm--html-noregion-forms-map nil
  388.   "Noregion sub keymap for inserting forms.")
  389.  
  390. (if hm--html-noregion-forms-map
  391.     ()
  392.   (setq hm--html-noregion-forms-map (make-sparse-keymap))
  393.   )
  394.  
  395. (defvar hm--html-region-forms-map nil
  396.   "Region sub keymap for inserting forms.")
  397.  
  398. (if hm--html-region-forms-map
  399.     ()
  400.   (setq hm--html-region-forms-map (make-sparse-keymap))
  401.   )
  402.  
  403. (defvar hm--html-region-sub-map-1 nil
  404.   "Region sub keymap for the html-mode.")
  405.  
  406. (if hm--html-region-sub-map-1
  407.     ()
  408.   (setq hm--html-region-sub-map-1 (make-sparse-keymap))
  409. ;  (define-key hm--html-region-sub-map-1 "\C-e" hm--html-region-entity-map)
  410. ;  (define-key hm--html-region-sub-map-1 "\C-l" hm--html-region-logical-map)
  411. ;  (define-key hm--html-region-sub-map-1 "\C-p" hm--html-region-physical-map)
  412. ;  (define-key hm--html-region-sub-map-1 "\C-h" hm--html-region-header-map)
  413.   (define-key hm--html-region-sub-map-1 "\C-o" hm--html-region-forms-map)
  414. ;  (define-key hm--html-region-sub-map-1 "\C-l" hm--html-region-list-map)
  415.   (define-key hm--html-region-sub-map-1 "\C-a" hm--html-region-anchor-map)
  416.   (define-key hm--html-region-sub-map-1 "\C-i" hm--html-region-graphics-map)
  417.   (define-key hm--html-region-sub-map-1 
  418.     "\C-t" hm--html-region-text-elements-map)
  419. ;  (define-key hm--html-region-sub-map-1 "\C-b" hm--html-region-head-map)
  420.   (define-key hm--html-region-sub-map-1 "\C-f" hm--html-region-frame-map)
  421.   (define-key hm--html-region-sub-map-1 "\C-s" hm--html-region-structure-map)
  422.   (define-key hm--html-region-sub-map-1 
  423.     "\C-p" hm--html-region-formating-paragraph-map)
  424.   (define-key hm--html-region-sub-map-1
  425.     "\C-w" hm--html-region-formating-word-map)
  426.   )
  427.  
  428. (defvar hm--html-noregion-sub-map-1 nil
  429.   "Noregion sub keymap for the html-mode.")
  430.  
  431. (if hm--html-noregion-sub-map-1
  432.     ()
  433.   (setq hm--html-noregion-sub-map-1 (make-sparse-keymap))
  434.   
  435.  
  436. ;  (define-key hm--html-noregion-sub-map-1 "\C-e" hm--html-noregion-entity-map)
  437. ;  (define-key hm--html-noregion-sub-map-1 
  438. ;    "\C-l" hm--html-noregion-logical-map)
  439. ;  (define-key hm--html-noregion-sub-map-1 
  440. ;    "\C-p" hm--html-noregion-physical-map)
  441. ;  (define-key hm--html-noregion-sub-map-1 
  442. ;    [(control h)] hm--html-noregion-header-map)
  443.   (define-key hm--html-noregion-sub-map-1 "\C-o" hm--html-noregion-forms-map)
  444. ;  (define-key hm--html-noregion-sub-map-1 "\C-l" hm--html-noregion-list-map)
  445.   (define-key hm--html-noregion-sub-map-1 "\C-a" hm--html-noregion-anchor-map)
  446.   (define-key hm--html-noregion-sub-map-1 
  447.     [(control i)] hm--html-noregion-graphics-map)
  448.   (define-key hm--html-noregion-sub-map-1 
  449.     "\C-t" hm--html-noregion-text-elements-map)
  450. ;  (define-key hm--html-noregion-sub-map-1 "\C-b" hm--html-noregion-head-map)
  451.   (define-key hm--html-noregion-sub-map-1 "\C-f" hm--html-noregion-frame-map)
  452.   (define-key hm--html-noregion-sub-map-1 
  453.     "\C-s" hm--html-noregion-structure-map)
  454.   (define-key hm--html-noregion-sub-map-1
  455.     "\C-p" hm--html-noregion-formating-paragraph-map)
  456.   (define-key hm--html-noregion-sub-map-1
  457.     "\C-w" hm--html-noregion-formating-word-map)
  458.   )
  459.  
  460. (defvar hm--html-region-sub-map nil
  461.   "Region sub keymap for the html-mode.")
  462.  
  463. (if hm--html-region-sub-map
  464.     ()
  465.   (setq hm--html-region-sub-map (make-sparse-keymap))
  466. ;  (define-key hm--html-region-sub-map "\C-n" hm--html-noregion-sub-map-1)
  467. ;  (define-key hm--html-region-sub-map "\C-r" hm--html-region-sub-map-1)
  468.   (define-key hm--html-region-sub-map "\M-n" hm--html-noregion-sub-map-1)
  469.   (define-key hm--html-region-sub-map "\M-r" hm--html-region-sub-map-1)
  470.  
  471.   (if (adapt-emacs19p)
  472.       (map-keymap '(lambda (key-description-list binding)
  473.              (define-key hm--html-region-sub-map
  474.                (single-key-description key-description-list) binding))
  475.           hm--html-region-sub-map-1)
  476.     (map-keymap '(lambda (key-description-list binding)
  477.            (define-key hm--html-region-sub-map
  478.              key-description-list binding))
  479.         hm--html-region-sub-map-1)
  480.     )
  481.   )
  482.  
  483. (defvar hm--html-noregion-sub-map nil
  484.   "Noregion keymap for the html-mode.")
  485.  
  486. (if hm--html-noregion-sub-map
  487.     ()
  488.   (setq hm--html-noregion-sub-map (make-sparse-keymap))
  489. ;  (define-key hm--html-noregion-sub-map "\C-n" hm--html-noregion-sub-map-1)
  490. ;  (define-key hm--html-noregion-sub-map "\C-r" hm--html-region-sub-map-1)
  491.   (define-key hm--html-noregion-sub-map "\M-n" hm--html-noregion-sub-map-1)
  492.   (define-key hm--html-noregion-sub-map "\M-r" hm--html-region-sub-map-1)
  493.  
  494.   (if (adapt-emacs19p)
  495.       (map-keymap '(lambda (key-description-list binding)
  496.              (define-key hm--html-region-sub-map
  497.                (single-key-description key-description-list) binding))
  498.           hm--html-region-sub-map-1)
  499.     (map-keymap '(lambda (key-description-list binding)
  500.            (define-key hm--html-noregion-sub-map
  501.              key-description-list binding))
  502.         hm--html-noregion-sub-map-1)
  503.     )
  504.   )
  505.  
  506. (defvar hm--html-mode-map nil
  507.   "Normal and noregion keymap for the html-mode.")
  508.  
  509. (if hm--html-mode-map
  510.     ()
  511.   (setq hm--html-mode-map (make-sparse-keymap))
  512.   (define-key hm--html-mode-map "\C-c" hm--html-noregion-sub-map)
  513.   (if (adapt-xemacsp)
  514.       (define-key hm--html-mode-map '(button3) 'hm--popup-html-menu)
  515.     (define-key hm--html-mode-map [mouse-3] 'hm--popup-html-menu))
  516.   (if hm--html-bind-latin-1-char-entities
  517.       (progn
  518.     (define-key hm--html-mode-map [adiaeresis] 'hm--html_ae)
  519.     (define-key hm--html-mode-map [odiaeresis] 'hm--html_oe) 
  520.     (define-key hm--html-mode-map [udiaeresis] 'hm--html_ue) 
  521.     (define-key hm--html-mode-map [Adiaeresis] 'hm--html_Ae) 
  522.     (define-key hm--html-mode-map [Odiaeresis] 'hm--html_Oe) 
  523.     (define-key hm--html-mode-map [Udiaeresis] 'hm--html_Ue) 
  524.     (define-key hm--html-mode-map [ediaeresis] 'hm--html_ediaeresis) 
  525.     (define-key hm--html-mode-map [Ediaeresis] 'hm--html_Ediaeresis) 
  526.     (define-key hm--html-mode-map [idiaeresis] 'hm--html_idiaeresis) 
  527.     (define-key hm--html-mode-map [Idiaeresis] 'hm--html_Idiaeresis) 
  528.     (define-key hm--html-mode-map [ssharp] 'hm--html_sz) 
  529.     (define-key hm--html-mode-map [aacute] 'hm--html_aacute) 
  530.     (define-key hm--html-mode-map [eacute] 'hm--html_eacute) 
  531.     (define-key hm--html-mode-map [iacute] 'hm--html_iacute) 
  532.     (define-key hm--html-mode-map [oacute] 'hm--html_oacute) 
  533.     (define-key hm--html-mode-map [uacute] 'hm--html_uacute) 
  534.     (define-key hm--html-mode-map [Aacute] 'hm--html_Aacute) 
  535.     (define-key hm--html-mode-map [Eacute] 'hm--html_Eacute) 
  536.     (define-key hm--html-mode-map [Iacute] 'hm--html_Iacute) 
  537.     (define-key hm--html-mode-map [Oacute] 'hm--html_Oacute) 
  538.     (define-key hm--html-mode-map [Uacute] 'hm--html_Uacute) 
  539.     (define-key hm--html-mode-map [agrave] 'hm--html_agrave) 
  540.     (define-key hm--html-mode-map [egrave] 'hm--html_egrave) 
  541.     (define-key hm--html-mode-map [igrave] 'hm--html_igrave) 
  542.     (define-key hm--html-mode-map [ograve] 'hm--html_ograve) 
  543.     (define-key hm--html-mode-map [ugrave] 'hm--html_ugrave) 
  544.     (define-key hm--html-mode-map [Agrave] 'hm--html_Agrave) 
  545.     (define-key hm--html-mode-map [Egrave] 'hm--html_Egrave) 
  546.     (define-key hm--html-mode-map [Igrave] 'hm--html_Igrave) 
  547.     (define-key hm--html-mode-map [Ograve] 'hm--html_Ograve) 
  548.     (define-key hm--html-mode-map [Ugrave] 'hm--html_Ugrave) 
  549.     (define-key hm--html-mode-map [ccedilla] 'hm--html_ccedilla) 
  550.     (define-key hm--html-mode-map [Ccedilla] 'hm--html_Ccedilla) 
  551.     (define-key hm--html-mode-map [acircumflex] 'hm--html_acircumflex) 
  552.     (define-key hm--html-mode-map [ecircumflex] 'hm--html_ecircumflex) 
  553.     (define-key hm--html-mode-map [icircumflex] 'hm--html_icircumflex) 
  554.     (define-key hm--html-mode-map [ocircumflex] 'hm--html_ocircumflex) 
  555.     (define-key hm--html-mode-map [ucircumflex] 'hm--html_ucircumflex) 
  556.     (define-key hm--html-mode-map [Acircumflex] 'hm--html_Acircumflex) 
  557.     (define-key hm--html-mode-map [Ecircumflex] 'hm--html_Ecircumflex) 
  558.     (define-key hm--html-mode-map [Icircumflex] 'hm--html_Icircumflex) 
  559.     (define-key hm--html-mode-map [Ocircumflex] 'hm--html_Ocircumflex) 
  560.     (define-key hm--html-mode-map [Ucircumflex] 'hm--html_Ucircumflex)
  561.     (define-key hm--html-mode-map [atilde] 'hm--html_atilde) 
  562.     (define-key hm--html-mode-map [otilde] 'hm--html_otilde) 
  563.     (define-key hm--html-mode-map [ntilde] 'hm--html_ntilde) 
  564.     (define-key hm--html-mode-map [Atilde] 'hm--html_Atilde) 
  565.     (define-key hm--html-mode-map [Otilde] 'hm--html_Otilde) 
  566.     (define-key hm--html-mode-map [Ntilde] 'hm--html_Ntilde) 
  567.     (define-key hm--html-mode-map [eth] 'hm--html_eth) 
  568.     (define-key hm--html-mode-map [ETH] 'hm--html_Eth) 
  569.     (define-key hm--html-mode-map [thorn] 'hm--html_thorn) 
  570.     (define-key hm--html-mode-map [THORN] 'hm--html_Thorn) 
  571.     ))
  572.   (define-key hm--html-mode-map "<" 'hm--html-smart-less-than)
  573.   (define-key hm--html-mode-map ">" 'hm--html-smart-greater-than)
  574.   (define-key hm--html-mode-map "&" 'html-ampersand)
  575.   )
  576.  
  577. (defvar hm--html-region-mode-map nil
  578.   "Region keymap for the html-mode.")
  579.  
  580. (if hm--html-region-mode-map
  581.     ()
  582.   (setq hm--html-region-mode-map (make-sparse-keymap))
  583.   (define-key hm--html-region-mode-map "\C-c" hm--html-region-sub-map)
  584.   (if (adapt-xemacsp)
  585.       (define-key hm--html-region-mode-map 
  586.     '(button3) 'hm--popup-html-menu-region)
  587.     (define-key hm--html-region-mode-map 
  588.     [mouse-3] 'hm--popup-html-menu-region))
  589.   ;; It maybe a better idea to set the following to undefine in this list...
  590.   (if hm--html-bind-latin-1-char-entities
  591.       (progn
  592.     (define-key hm--html-region-mode-map [adiaeresis] 'hm--html_ae)
  593.     (define-key hm--html-region-mode-map [odiaeresis] 'hm--html_oe) 
  594.     (define-key hm--html-region-mode-map [udiaeresis] 'hm--html_ue) 
  595.     (define-key hm--html-region-mode-map [Adiaeresis] 'hm--html_Ae) 
  596.     (define-key hm--html-region-mode-map [Odiaeresis] 'hm--html_Oe) 
  597.     (define-key hm--html-region-mode-map [Udiaeresis] 'hm--html_Ue) 
  598.     (define-key hm--html-region-mode-map 
  599.       [ediaeresis] 'hm--html_ediaeresis) 
  600.     (define-key hm--html-region-mode-map 
  601.       [Ediaeresis] 'hm--html_Ediaeresis) 
  602.     (define-key hm--html-region-mode-map 
  603.       [idiaeresis] 'hm--html_idiaeresis) 
  604.     (define-key hm--html-region-mode-map 
  605.       [Idiaeresis] 'hm--html_Idiaeresis) 
  606.     (define-key hm--html-region-mode-map [ssharp] 'hm--html_sz) 
  607.     (define-key hm--html-region-mode-map [aacute] 'hm--html_aacute) 
  608.     (define-key hm--html-region-mode-map [eacute] 'hm--html_eacute) 
  609.     (define-key hm--html-region-mode-map [iacute] 'hm--html_iacute) 
  610.     (define-key hm--html-region-mode-map [oacute] 'hm--html_oacute) 
  611.     (define-key hm--html-region-mode-map [uacute] 'hm--html_uacute) 
  612.     (define-key hm--html-region-mode-map [Aacute] 'hm--html_Aacute) 
  613.     (define-key hm--html-region-mode-map [Eacute] 'hm--html_Eacute) 
  614.     (define-key hm--html-region-mode-map [Iacute] 'hm--html_Iacute) 
  615.     (define-key hm--html-region-mode-map [Oacute] 'hm--html_Oacute) 
  616.     (define-key hm--html-region-mode-map [Uacute] 'hm--html_Uacute) 
  617.     (define-key hm--html-region-mode-map [agrave] 'hm--html_agrave) 
  618.     (define-key hm--html-region-mode-map [egrave] 'hm--html_egrave) 
  619.     (define-key hm--html-region-mode-map [igrave] 'hm--html_igrave) 
  620.     (define-key hm--html-region-mode-map [ograve] 'hm--html_ograve) 
  621.     (define-key hm--html-region-mode-map [ugrave] 'hm--html_ugrave) 
  622.     (define-key hm--html-region-mode-map [Agrave] 'hm--html_Agrave) 
  623.     (define-key hm--html-region-mode-map [Egrave] 'hm--html_Egrave) 
  624.     (define-key hm--html-region-mode-map [Igrave] 'hm--html_Igrave) 
  625.     (define-key hm--html-region-mode-map [Ograve] 'hm--html_Ograve) 
  626.     (define-key hm--html-region-mode-map [Ugrave] 'hm--html_Ugrave) 
  627.     (define-key hm--html-region-mode-map [ccedilla] 'hm--html_ccedilla) 
  628.     (define-key hm--html-region-mode-map [Ccedilla] 'hm--html_Ccedilla) 
  629.     (define-key hm--html-region-mode-map 
  630.       [acircumflex] 'hm--html_acircumflex) 
  631.     (define-key hm--html-region-mode-map 
  632.       [ecircumflex] 'hm--html_ecircumflex) 
  633.     (define-key hm--html-region-mode-map 
  634.       [icircumflex] 'hm--html_icircumflex) 
  635.     (define-key hm--html-region-mode-map 
  636.       [ocircumflex] 'hm--html_ocircumflex) 
  637.     (define-key hm--html-region-mode-map 
  638.       [ucircumflex] 'hm--html_ucircumflex) 
  639.     (define-key hm--html-region-mode-map 
  640.       [Acircumflex] 'hm--html_Acircumflex) 
  641.     (define-key hm--html-region-mode-map 
  642.       [Ecircumflex] 'hm--html_Ecircumflex) 
  643.     (define-key hm--html-region-mode-map 
  644.       [Icircumflex] 'hm--html_Icircumflex) 
  645.     (define-key hm--html-region-mode-map 
  646.       [Ocircumflex] 'hm--html_Ocircumflex) 
  647.     (define-key hm--html-region-mode-map 
  648.       [Ucircumflex] 'hm--html_Ucircumflex)
  649.     (define-key hm--html-region-mode-map [atilde] 'hm--html_atilde) 
  650.     (define-key hm--html-region-mode-map [otilde] 'hm--html_otilde) 
  651.     (define-key hm--html-region-mode-map [ntilde] 'hm--html_ntilde) 
  652.     (define-key hm--html-region-mode-map [Atilde] 'hm--html_Atilde) 
  653.     (define-key hm--html-region-mode-map [Otilde] 'hm--html_Otilde) 
  654.     (define-key hm--html-region-mode-map [Ntilde] 'hm--html_Ntilde) 
  655.     (define-key hm--html-region-mode-map [eth] 'hm--html_eth) 
  656.     (define-key hm--html-region-mode-map [ETH] 'hm--html_Eth) 
  657.     (define-key hm--html-region-mode-map [thorn] 'hm--html_thorn) 
  658.     (define-key hm--html-region-mode-map [THORN] 'hm--html_Thorn) 
  659.     ))
  660.   (define-key hm--html-region-mode-map "<" 'html-less-than)
  661.   (define-key hm--html-region-mode-map ">" 'html-greater-than)
  662.   (define-key hm--html-region-mode-map "&" 'html-ampersand)
  663.   )
  664.  
  665.  
  666. ;;; -----
  667.  
  668. ;(use-local-map hm--html-mode-map)
  669.  
  670. (or (assq 'hm--html-region-mode minor-mode-alist)
  671.     (setq minor-mode-alist
  672.       (purecopy
  673.        (append minor-mode-alist
  674.            '((hm--html-region-mode " Region"))))))
  675.  
  676.  
  677.  
  678. (defun html-region-mode (on)
  679.   "Turns the minor mode html-region-mode on or off.
  680. The function turns the html-region-mode on, if ON is t and off otherwise."
  681.   (if (string= mode-name "HTML")
  682.       (if on
  683.       ;; html-region-mode on
  684.       (progn
  685.         (setq hm--html-region-mode t)
  686.         (use-local-map hm--html-region-mode-map))
  687.     ;; html-region-mode off
  688.     (setq hm--html-region-mode nil)
  689.     (use-local-map hm--html-mode-map))))
  690.  
  691.